package com.zjj.service.Impl;

import com.zjj.entity.User;
import com.zjj.entity.UserDTO;
import com.zjj.mapper.UserMapper;
import com.zjj.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class UserServiceImpl implements UserService {
    @Autowired
    UserMapper userMapper;
    @Override
    public int add(User user) {
        System.out.println("..");
        return userMapper.add(user);
    }

    @Override
    public int del(int id) {
        System.out.println("..");
        return userMapper.delete(id);
    }

    @Override
    public int update(User user) {
        System.out.println("..");
        return userMapper.update(user);
    }

    @Override
    public List<UserDTO> select() {
        System.out.println("..");
        return userMapper.select();
    }
}
